package com.gp.service.calculate;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import org.springframework.stereotype.Service;

import com.gp.model.entity.BaseOrder;

/**
 * @author: 弓成龙
 * @date : 2017年12月2日
 * @email : gcx909109@sina.cn
 * @description:
 */
public class ProfitDataAndRuleFactory extends AbstarctDataAndRuleFactory {

  private Random random = new Random();

  /**
   * 计算的规则应该从数据库中获取，此处模拟
   */
  @Override
  public CalculateRule loadCalculateRule() {
    ProfitRuleInfo profitRuleInfo = new ProfitRuleInfo();
    profitRuleInfo.setDirectProfitRate(0.12);
    profitRuleInfo.setSecondProfitRate(0.08);
    profitRuleInfo.setThirdProfitRate(0.05);
    return profitRuleInfo;
  }


  /**
   * 计算的数据应该从数据库中获取，此处模拟
   */
  @Override
  public CalculateData loadCalculateData() {
    ProfitDataInfo profitDataInfo = new ProfitDataInfo();
    
    List<BaseOrder> order = new ArrayList<BaseOrder>();
    profitDataInfo.setOrderBySecondLevel(order);
   
    List<BaseOrder> order1 = new ArrayList<BaseOrder>();
    profitDataInfo.setOrderByself(order1);

    List<BaseOrder> order2 = new ArrayList<BaseOrder>();
    profitDataInfo.setOrderByThirdLevel(order2);
    
    return profitDataInfo;
  }

}

